package com.mrkun.vueshop.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mrkun.vueshop.DTO.FundInfoDTO;
import com.mrkun.vueshop.mapper.FundInfoMapper;
import com.mrkun.vueshop.model.FundInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author by yong
 * @date 2020/3/18
 */
@Service
public class FundInfoService {
    @Autowired
    private FundInfoMapper fundInfoMapper;

    public List<FundInfo> findFundInfo(Integer page,Integer size,String query){
        PageHelper.startPage(page,size);
        return fundInfoMapper.findAll(query);
    }

    public PageInfo<FundInfoDTO> findFundInfoList(Integer page,Integer size,String date,String fundType,String query){
        PageHelper.startPage(page,size);
        List<FundInfoDTO> all = fundInfoMapper.getAll(date,fundType,query);
        return new PageInfo<FundInfoDTO>(all);

    }

}
